﻿using Abp.Domain.Entities.Auditing;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace FutureApp.Shop
{
    /// <summary>
    /// 商品价格
    /// </summary>
    [Table("GoodsPrices")]
    public class GoodsPrice : AuditedEntity<Guid, Users.User>
    {
        /// <summary>
        /// Id
        /// </summary>
        [Key,ForeignKey(nameof(Goods))]
        public override Guid Id { get; set; }

        /// <summary>
        /// 商品
        /// </summary>
        public virtual Goods Goods { get; set; }

        /// <summary>
        /// 价格
        /// </summary>
        [Range(0, double.MaxValue)]
        [DecimalPrecision(18, 8)]
        public virtual decimal Price { get; set; }

        /// <summary>
        /// 促销价
        /// </summary>
        [Range(0, double.MaxValue)]
        [DecimalPrecision(18, 8)]
        public virtual decimal SalePrice { get; set; }

        /// <summary>
        /// 最低价
        /// </summary>
        [Range(0, double.MaxValue)]
        [DecimalPrecision(18, 8)]
        public virtual decimal BottomPrice { get; set; }
    }
}
